import React from "react";
import { Row, Col, Button, PageHeader } from "antd";
import { EditFilled } from "@ant-design/icons";
import { Link } from "react-router-dom";
import "braft-editor/dist/output.css";
class AddArticle extends React.Component {
  state = {
    editorState: null,
  };

  async componentDidMount() {
    let d_user = await JSON.parse(localStorage.getItem("d_user"));
    const htmlContent = d_user.user_introduce;
    this.setState({
      editorState: htmlContent,
    });
  }

  render() {
    return (
      <div style={{ minHeight: 360 }}>
        <Row justify="end">
          <Col span={24}>
            <PageHeader
              ghost={false}
              subTitle="个人主页"
              extra={[
                <Link to="/m/personalcenter/b/e">
                  <Button type="primary" block icon={<EditFilled />}>
                    编辑
                  </Button>
                </Link>,
              ]}
            ></PageHeader>
          </Col>
        </Row>
        <br />
        <Row>
          <Col span={24}>
            <div
              className="braft-output-content"
              dangerouslySetInnerHTML={{
                __html: this.state.editorState,
              }}
            ></div>
          </Col>
        </Row>
      </div>
    );
  }
}

export default AddArticle;
